package com.wonders.hisdoctor.station.enums;

import lombok.Getter;

/**
 * oracle 表id 生成枚举类
 * @author tyang
 */

@Getter
public enum OracleSequenceEnum {


    /**
     * OPERATOR_DICT 操作员字典表(必须大写)
     */
    SEQ_PAT_VACCINE_INFO("SEQ_ID_PAT_VACCINE_INFO",10L,"患者疫苗接种信息表id"),
    SEQ_PAT_VACCINE_REGISTER("SEQ_ID_PAT_VACCINE_REGISTER",10L,"患者疫苗接种登记表id"),
    SEQ_OUTP_CIPHER_PRESC("SEQ_ID_OUTP_CIPHER_PRESC",10L,"协定处方主表id"),
    SEQ_OUTP_ORDERS("SEQ_ID_OUTP_ORDERS",10L,"门诊医嘱处方主记录表id"),
    SEQ_OUTP_PRESC("SEQ_ID_OUTP_PRESC",10L,"门诊医嘱处方明细记录表id"),
    SEQ_MANAGED_DRUG_CLASS_DICT("SEQ_ID_MANAGED_DRUG_CLASS_DICT",10L,"特殊管理药品类别字典表id"),
    SEQ_DRUG_DISP_PROPERTY_DICT("SEQ_ID_DRUG_DISP_PROPERTY_DICT",10L,"药品摆药类别字典表id"),
    SEQ_DRUG_EXPORT_CLASS_DICT("SEQ_ID_DRUG_EXPORT_CLASS_DICT",10L,"药品出库分类字典表id"),
    SEQ_DRUG_IMPORT_CLASS_DICT("SEQ_ID_DRUG_IMPORT_CLASS_DICT",10L,"药品入库分类字典表id"),
    OPERATOR_DICT("SEQ_ID_OPERATOR_DICT",300L, "操作员字典表id"),
    SYS_ROLE_INFO("SEQ_ID_SYS_ROLE_INFO",300L, "角色信息表id"),
    SEQ_ROLE_INFO("SEQ_ID_ROLE_INFO",300L, "角色信息表id"),
    SYS_ROLE_VS_POWER("SEQ_ID_SYS_ROLE_VS_POWER",300L,"系统_角色权限对应表id"),
    SEQ_STAFF_VS_DEPT("SEQ_ID_STAFF_VS_DEPT_VS",300L,"工作人员与科室对应表id"),
    SEQ_SYS_ROLE_VS_OPERATOR("SEQ_ID_SYS_ROLE_VS_OPERATOR",300L,"系统_角色操作员对应表"),
    SEQ_CHARGE_TYPE_DICT("SEQ_ID_CHARGE_TYPE_DICT",300L,"费别字典表id"),
    SEQ_DEPT_VS_STAFF("SEQ_ID_DEPT_VS_STAFF",300L,"管理科室人员对应表id"),
    SEQ_HOSPITAL_VS_STAFF("SEQ_ID_HOSPITAL_VS_STAFF",300L,"机构人员所属科室对应表id"),
    SEQ_ID_APP_MENU("SEQ_ID_APP_MENU",10L,"菜单表"),
    SEQ_APP_CONFIG("SEQ_ID_APP_CONFIG",100L,"全局配置表id"),
    SEQ_ID_EXAM_MASTER("SEQ_ID_EXAM_MASTER",10L,"检查主记录表id"),
    DRUG_CODING_RULE("SEQ_ID_DRUG_CODING_RULE",10L,"药品编码描述表id"),
    SEQ_ID_WDEDITOR_DSSET("SEQ_ID_WDEDITOR_DSSET",1L,"数据源配置表id"),
    SEQ_ID_TEMPLATE_MASTER("SEQ_ID_TEMPLATE_MASTER",1L,"个人模板主表id"),
    SEQ_ID_TEMPLATE_DETAIL("SEQ_ID_TEMPLATE_DETAIL",1L,"个人模板明细表id"),
    SEQ_ID_WDEDITOR_DSSET_CUSTOM("SEQ_ID_WDEDITOR_DSSET_CUSTOM",1L,"数据源配置表_自定义id"),
    SEQ_LAB_TEST_MASTER("SEQ_ID_LAB_TEST_MASTER",10L,"检验主记录表id"),
    SEQ_PAT_ALLERGY("SEQ_ID_PAT_ALLERGY",10L,"过敏登记表id"),
    SEQ_INFEC_INFO("SEQ_ID_INFEC_INFO",10L,"传染病报卡id"),
    SEQ_ID_VACCINE_LOG("SEQ_ID_VACCINE_LOG",1L,"疫苗修改日志表id"),
    SEQ_ID_VACCINE_STOCK("SEQ_ID_VACCINE_STOCK",1L,"疫苗库存表id")
    ;

    private String code;

    private Long startWith;

    private String desc;

    OracleSequenceEnum(String code, Long startWith, String desc) {
        this.code = code;
        this.startWith = startWith;
        this.desc = desc;
    }


    public static OracleSequenceEnum getByCode(String code) {
        for (OracleSequenceEnum oracleSequenceEnum : OracleSequenceEnum.values()) {
            if (code.equals(oracleSequenceEnum.getCode())) {
                return oracleSequenceEnum;
            }
        }
        return null;
    }

}
